package com.example.binpacking.controller;

import com.example.binpacking.model.DictionaryRight;
import com.example.binpacking.model.Result;
import com.example.binpacking.service.DictionaryRightService;
import com.example.binpacking.util.DataFormatter;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/pelicanpsyc")
public class DictionaryRightController {
    @Autowired
    private DictionaryRightService dictionaryRightService;
    @ApiOperation("获取知情书数据")
    @PostMapping("/api/getright")
    public Result selectRightData(){
        List<DictionaryRight> list = dictionaryRightService.selectRightData();
//        Map<String, Object> formattedData = DataFormatter.formatDataByNull(list);
        return Result.success(200,"y",list);
    }
}

